<template lang="pug">
	.hospital-record-detail-wrap
		.record-top-info
			.name {{name}}
			.day 共住院{{recordDetail.hospitalDays}}天
		.record-detail-item
			.hospital-info
				| 住院信息
				.time （住院时间 {{recordDetail.ryrq}}）
			.detail-item-content
				.detail-item
					p 就诊卡
					span {{recordDetail.cardType == '1'? '健康卡':'市民卡'}} {{recordDetail.kh}}
				.detail-item
					p 所住医院
					span {{recordDetail.org_name}}
				.detail-item
					p 住院医生
					span {{recordDetail.zyys}}
				.detail-item
					p 所在病区
					span {{recordDetail.bq}}
				.detail-item
					p 入院诊断
					span {{recordDetail.ryzd}}
		.record-detail-item
			.total-item
				p 费用总计
				span ¥{{recordDetail.zje}}
			.total-item
				p 医保报销
				span ¥{{recordDetail.ybje}}
</template>

<script>
export default {
	name: 'hospitalRecordDetail',
	data() {
		return {
			recordDetail: {},
			name: ''
		}
	},
	created() {},
	mounted() {
		this.name = this.wx.getStorageSync('findPatient').name
		this.hospitalRecordDetail()
	},
	methods: {
		hospitalRecordDetail() {
			this.wx.showLoading({
				title: '加载中',
				icon: 'none'
			})
			let userInfo = this.wx.getStorageSync('userInfo')
			this.api.jtApi
				.hospitalRecordDetail({
					access_token: userInfo.accessToken,
					member_num: userInfo.memberNum,
					org_code: this.$route.query.orgCode,
					zylsh: this.$route.query.zylsh
				})
				.then(data => {
					this.wx.hideLoading()
					if (data.ret_code === '0') {
						data.zje = this.filter.formatIncome(data.zje)
						data.ybje = this.filter.formatIncome(data.ybje)
						data.hospitalDays = this.dayjs(data.cyrq).diff(
							this.dayjs(data.ryrq),
							'day'
						)
						this.recordDetail = data
					}
				})
				.catch(() => {
					this.wx.hideLoading()
				})
		}
	}
}
</script>

<style lang="stylus">
	.hospital-record-detail-wrap
		.record-top-info
			line-height 124px
			display flex
			justify-content space-between
			font-size 32px
			font-weight 600
			padding 0 mainPadding
			background-color white
			.name
				color blackFontColor1A
			.day
				color blackFontColor66
		.record-detail-item
			background white
			margin-top mainMargin
			padding 0 mainPadding
			.hospital-info
				display flex
				color blackFontColor1A
				font-weight 600
				font-size 32px
				height 100px
				line-height 100px
				.time
					font-size 26px
					margin-left 15px
					color blackFontColor66
			.detail-item-content
				padding 30px 0 10px
				border-top borderStyle
			.detail-item
				display flex
				align-items center
				justify-content space-between
				line-height 40px
				margin-bottom mainMargin
				font-size 28px
				p
					letter-spacing 4px
					color blackFontColor1A
				span
					color blackFontColor66
			.detail-footer
				line-height 100px
				font-size 28px
				color blackFontColor1A
				font-weight 500
				span
					color themeColor
					margin-left 20px
			.total-item
				line-height 100px
				font-size 28px
				font-weight 500
				display flex
				align-items center
				justify-content space-between
				p
					color blackFontColor1A
				span
					color blackFontColor66
				&:first-child
					border-bottom borderStyle

</style>
